<?php
$curr_page =2;
include 'head.php';

//if(isset($_POST["flag"]))
//{
//	if($_POST["flag"]=="find")
//	{
//		
//		if(isset($_POST["shi"]))
//		{
//			$shi = $_POST["shi"];//所选城市
//			$sql  =  "select id,name,city,address,path,remark from en_dealer where flag =1 and city like '%".$_POST["shen"].$shi[0]."%'";
//			
//			foreach ($shi as $s)
//			{
//				$sql = $sql." or city like '%".$_POST["shen"].$s."%' ";
//			}
//		}else
//		{
//			$sql = "select id,name,city,address,path,remark from en_dealer where flag =1 and city like '%".$_POST["shen"]."%'";
//		}
//		
//		
//		$result = mysql_query($sql);
//		
//	}
//}
?>
<link href="1.css" rel="stylesheet" type="text/css">
<style>
 .nava{
 	color:#369;
	text-decoration:none;
 }
 .nava:hover{
	text-decoration:underline;
 }
</style>
<script src="js/city.js"></script>
<script>
		$(document).ready(function(){

			$.each(provinceName,function(index,value){
				$("#shen").append("<option tag="+index+" value="+value+">"+value+"</option>");
			});

			choose();
			
		});

		function choose(){
				
			 var i =   parseInt($("#shen option:selected").attr("tag"))+1;
			 var  c = eval("city"+i);
			 var h ="";
			 $.each(c,function(index,value){
				 		h+= " <div class='fxk'><input name='shi[]' type='checkbox' value="+value+" />"+value+"</div>";
				 });
			 $("#citys").html(h);
		}
</script>
<div id="ym1">
				
				
				
				
				
			
				
				
				
				<!--主要内容-->
				<div style="background:#FFFFFF; width:960px; float:left;">
					
					
						<!--内容左-->
						<div class="left">
							<div class="gddh">Service Support</div>
							<div class="gddh1"><a class="nava" href="service.php" >Announcement</a></div>
							<div class="gddh1"><a class="nava" href="dealer.php" >Sales Outlets</a></div>
							<div class="gddh1"><a class="nava" href="question.php">FAQ</a></div>
							<div class="gg2" style="margin-top:15px; background:none;">
							<?php
							   $sql = "select * from en_ad where id = 14";
							   $ret = mysql_query($sql);
							   $rcd = mysql_fetch_array($ret);
							 ?>
							 <a href="<?php echo $rcd['link']?>" target='_blank'><img src="<?php echo $rcd['pic_path'];?>" /></a>
							</div>
							<div class="gg2" style=" background-image:none;margin-top:15px;">
							 <?php
							   $sql = "select * from en_ad where id = 15";
							   $ret = mysql_query($sql);
							   $rcd = mysql_fetch_array($ret);
							 ?>
							 <a href="<?php echo $rcd['link']?>" target='_blank'><img src="<?php echo $rcd['pic_path'];?>" /></a>
							</div>
							<div class="gg2" style="margin-top:15px;background:none;">
							 <?php
							   $sql = "select * from en_ad where id = 16";
							   $ret = mysql_query($sql);
							   $rcd = mysql_fetch_array($ret);
							 ?>
							 <a href="<?php echo $rcd['link']?>" target='_blank'><img src="<?php echo $rcd['pic_path'];?>" /></a>
							</div>
						</div>
						<!--内容左-->
						
						
						<!--内容右-->
						<div  style="width:735px; float: left;">
							
							<div class="right" style="background:url(images/xw_nrt.jpg); margin-top:16px;width:737px; height:33px; float: left;">
								<span style=" margin-left:16px; font-size:12px; font: '宋体';line-height:33px; font-weight:bold; ">Sales Outlets</span>
							</div>
							
							
							<!--列表-->
							<div style=" border:1px solid #c8c8c8; float:left; margin-top:-1px; width:735px; padding-bottom:46px;">
							
		<!--说明-->
							
		
		<!--说明-->
		
		<!--查找-->
		<form action="dealer.php" method="post">
		 <input type="hidden" name="flag" value="find" />
		<div style="width:717px; height:203px;margin:0 0 0 9px;">
				<!--城市搜索-->
				        <?php 
				           $sql = "select * from en_dealer where type = 1";
				           $result = mysql_query($sql);
				           if(mysql_affected_rows() > 0){
				        ?>
						
						<!--推荐标题栏-->
						<div style="background-color:#f1f1f1; width:717px; height:28px; font-family:'宋体'; font-size:12px; color:#393939; float:left; margin-top:24px;">
								<div style="background: url(images/icon1.png); background-repeat:no-repeat; width:19px; height:28px; float:left; margin-top:4px; margin-left:5px;"></div>
							    <span  style="line-height:28px; float:left; margin-left:12px;">Entity dealers</span>
						</div>
						<!--推荐标题栏-->
						
						<!--查询结果列表-->
						<div style="clear:both;"></div>
						<table width="100%">
							<tr>
							  <th align="left" width="20%">Name</th>
							  <th align="left" width="30%">Address</th>
							  <th align="left" width="15%">Contact</th>
							  <th align="left" width="15%">Phone</th>
							  <th align="left" width="20%">Product</th>
							</tr>
						<?php 
							while($row = mysql_fetch_array($result))
							{
						?>
							<tr style="height:30px;">
							  <td style="padding:5px 5px 5px 0;" valign="middle"><?php echo $row['name'];?></td>
							  <td style="padding:5px 5px 5px 0;" valign="middle"><?php echo $row['city'].$row['address'];?></td>
							  <td style="padding:5px 5px 5px 0;" valign="middle"><?php echo $row['contact_name'];?></td>
							  <td style="padding:5px 5px 5px 0;" valign="middle"><?php echo $row['phone'];?></td>
							  <td style="padding:5px 5px 5px 0;" valign="middle"><?php echo $row['remark'];?></td>
							</tr>
						
						<?php
							}
						?>
						</table>
					<?php
		                  }
		            ?>  
		            
		            
		            <?php 
				           $sql = "select * from en_dealer where type = 2";
				           $result = mysql_query($sql);
				           if(mysql_affected_rows() > 0){
				        ?>
						
						<!--推荐标题栏-->
						<div style="background-color:#f1f1f1; width:717px; height:28px; font-family:'宋体'; font-size:12px; color:#393939; float:left; margin-top:24px;">
								<div style="background: url(images/icon1.png); background-repeat:no-repeat; width:19px; height:28px; float:left; margin-top:4px; margin-left:5px;"></div>
							    <span  style="line-height:28px; float:left; margin-left:12px;">Taobao dealers</span>
						</div>
						<!--推荐标题栏-->
						
						<!--查询结果列表-->
						<div style="clear:both;"></div>
						<table width="100%">
							<tr>
							  <th align="left" width="20%">Name</th>
							  <th align="left" width="30%">Address</th>
							  <th align="left" width="30%">Website</th>
							  <th align="left" width="20%">Product</th>
							</tr>
						<?php 
							while($row = mysql_fetch_array($result))
							{
						?>
							<tr style="height:30px;">
							  <td style="padding:5px 5px 5px 0;" valign="middle"><?php echo $row['name'];?></td>
							  <td style="padding:5px 5px 5px 0;" valign="middle"><?php echo $row['city'];?></td>
							  <td style="padding:5px 5px 5px 0;" valign="middle"><?php echo $row['shop_address'];?></td>
							  <td style="padding:5px 5px 5px 0;" valign="middle"><?php echo $row['remark'];?></td>
							</tr>
						
						<?php
							}
						?>
						</table>
					<?php
		                  }
		            ?>           
						
		</div>
		</form>
		</div>

		
		<!--查找-->
			 </div>
							<!--列表-->
							
						
										
		
			
                         </div>
					   	<!--内容右-->
				</div>
				<!--主要内容-->				<div style="clear:both;"></div>
</div><?php include 'bottom.php';?>